<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>

	<input type="number" id="phoneNum">
	<button id="judege">按钮</button>
	
</body>
</html>
<script>

	var phoneNumInput = document.getElementById("phoneNum");
    var judegeBtn = document.getElementById("judege");

    judegeBtn.onclick = function(){

    	var phoneNum = phoneNumInput.value;

    	phoneNum = phoneNum - 0;
	/*switch(表达式) {
		case 值1:
		    代码块
		    break;
		 case 值2:
		    代码块;
		    break;
		 case 值3:
		     代码块;
		     break;
		     ...
		    default:
		      代码块;
		      break;

	}*/

           var phoneNum = 0;
           switch (phoneNum) {
           	      case 1:
           	           alert("一号");
           	           break;
           	       case 2:
           	            alert("二号");
           	            break;
           	       case 3:
           	             alert("三号");
           	             break;
           	       case 4:
           	             alert("四号");
           	             break;
           	       case 5:
           	              alert("五号");
           	              break;
           	              default:
           	                 
           	              break;

           }
           alert("这是第" + phoneNum + "号");
       };

</script>